home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / arch / arm / plat-mxc / include / mach / io.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-09  |  1.3 KB  |  48 lines

  1. /*
  2.  *  Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved.
  3.  */
  4.  
  5. /*
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License version 2 as
  8.  * published by the Free Software Foundation.
  9.  */
  10.  
  11. #ifndef __ASM_ARCH_MXC_IO_H__
  12. #define __ASM_ARCH_MXC_IO_H__
  13.  
  14. /* Allow IO space to be anywhere in the memory */
  15. #define IO_SPACE_LIMIT 0xffffffff
  16.  
  17. extern void __iomem *__mxc_ioremap(unsigned long cookie, size_t size,
  18.                 unsigned int mtype);
  19. extern void __mxc_iounmap(void __iomem *addr);
  20.  
  21. #define __arch_ioremap(a, s, f) __mxc_ioremap(a, s, f)
  22. #define __arch_iounmap(a)        __mxc_iounmap(a)
  23.  
  24. /* io address mapping macro */
  25. #define __io(a)            ((void __iomem *)(a))
  26.  
  27. #define __mem_pci(a)        (a)
  28.  
  29. /*!
  30.  * This function is called to read a CPLD register over CSPI.
  31.  *
  32.  * @param        offset    number of the cpld register to be read
  33.  *
  34.  * @return       Returns 0 on success -1 on failure.
  35.  */
  36. unsigned int spi_cpld_read(unsigned int offset);
  37.  
  38. /*!
  39.  * This function is called to write to a CPLD register over CSPI.
  40.  *
  41.  * @param        offset    number of the cpld register to be written
  42.  * @param        reg_val   value to be written
  43.  *
  44.  * @return       Returns 0 on success -1 on failure.
  45.  */
  46. unsigned int spi_cpld_write(unsigned int offset, unsigned int reg_val);
  47. #endif
  48.